package org.syh.boyangfighthealthclub.dao;

import org.syh.boyangfighthealthclub.entity.Book;

import java.sql.Connection;
import java.util.List;

/**
 * @Author: Ben
 * @Date: 2021/3/12 9:39
 */
public interface IBookDao {
    /**
     * 增加图书
     * @param book
     * @param connection
     * @return boolean
     */
    boolean insertBook(Connection connection,Book book);


    /**
     * 根据id删除图书
     * @param id
     * @param connection
     * @return boolean
     */
    boolean deleteBook(Connection connection,Integer id);


    /**
     * 更改图书信息
     * @param book
     * @param connection
     * @return boolean
     */
    boolean updateBook(Connection connection,Book book);


    /**
     * 分页查询Book
     * @param connection
     * @param pageNumber
     * @param pageSize
     * @return List<Book>
     */
    List<Book> selectBooks(Connection connection,int pageNumber,int pageSize);


    /**
     * 查询图书总数
     * @param connection
     * @return int
     */
    int selectBook(Connection connection);

    /**
     * 根据id查询图书
     * @param connection
     * @param id
     * @return Book
     */
    Book selectBookById(Connection connection,Integer id);


    /**
     * 根据书名查询图书信息
     * @param connection
     * @param bookName
     * @return Book
     */
    Book selectBookByBookName(Connection connection,String bookName);
    
}
